import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "layout",
    component: () => import(/* webpackChunkName: "layout" */ "@/layout"),
    children: [
      {
        path: "user",
        name: "user",
        component: () => import(/* webpackChunkName: "user" */ "@/views/user")
      },
      {
        path: "user/level",
        name: "level",
        component: () => import(/* webpackChunkName: "level" */ "@/views/level")
      },
      {
        path: "welcome",
        name: "welcome",
        component: () =>
          import(/* webpackChunkName: "welcome" */ "@/views/welcome")
      },
      {
        path: "/cate",
        name: "cate",
        component: () => import(/* webpackChunkName: "cate" */ "@/views/cate")
      },
      {
        path: "/goodAdd",
        name: "goodAdd",
        component: () =>
          import(/* webpackChunkName: "goodAdd" */ "@/views/goodAdd")
      },
      {
        path: "/params",
        name: "params",
        component: () =>
          import(/* webpackChunkName: "params" */ "@/views/params")
      }
    ]
  },
  {
    path: "/login",
    name: "login",
    component: () => import(/* webpackChunkName: "layout" */ "@/views/login")
  }
];

const router = new VueRouter({
  routes
});

export default router;
